<template>
   <div class="hour-array" >
        <search :sinfo="sinfo" :formatType="formatType"></search>
        <div id="listWrap" class="cla-wrap">
            <p class="p-msg hide"><i class="loading"></i>正在加载...</p>
            <div  class="right-Wrapper"  ref="rightWrapper">
              <div class="pro-area pb-100" >
                    <div v-for="(item,index) in dataonearray" :data-code="item.catalogCode" class="pro-cont right-list-hook" :key="item.id">
                       <span class="pro-title">
                          <img :src="item.imgUrl" :alt="item.catalogName">
                        </span>
                        <img v-if="!!item.promotionImg" :src="item.promotionImg" :alt="item.catalogName">

                        <dl class="pro-box" >
                          <dd class="pro-detail">
                             
                              <div v-for="(val,i) in item.childCatalogs" class="pro-detail-box" :key="item.id">
                                <div v-if="item.childCatalogs[i]">
                                    <dt v-if="index > 4 &&　index < 9 " v-text="item.childCatalogs[i].catalogName"></dt>
                                    <router-link  v-for="(v, n) in item.childCatalogs[i].childCatalogs" :to="{name:'shoplist', params:{catalogCode: v.catalogCode, formatType: formatType}}" :key="item.id">
                                      <img class="p-opa" alt="" :src="v.imgUrl">   
                                      <span class="catalogCode" :class="v.catalogCode"></span>
                                      <span class="parentCode" :class="v.parentCode"></span>
                                      <p class="p-title" v-text="v.catalogName"></p>
                                    </router-link>
                                </div>
                            </div>
 
                          </dd>

                        </dl>
                    </div>

                </div>
            </div>
    </div>
      
   </div>
</template>

<script>
    import search from "../search/search"
    import BScroll from 'better-scroll'
    import {  getBusy } from '@/service/getData'
    export default {
      props:['dataonearray','sinfo','formatType'],
      data(){
        return {
          // sinfo:"",
          rightWrapper:{},
          leftWrapper:{},
          listHeight:[],
          foodsScrollY:0
        }
      },
      components:{
        search
      },
      created(){
          
      },
      computed:{
         
      },
      mounted(){
       
      },
      watch:{
        dataonearray(){
            this.$nextTick(() => {
               this._initScroll();
            });  
        }
      },
      methods:{
          _initScroll() {
            this.rightWrapper = new BScroll(this.$refs.rightWrapper, {
              click: true,
              probeType: 3
            });
           
            
            // 监控滚动事件
            this.rightWrapper.on('scroll', (pos) => {
              this.foodsScrollY = Math.abs(Math.round(pos.y));
            })
          }
          
      }

    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="less" scoped>
 
.hour-array {
  background-color: #fbf9fe;
}
.right-Wrapper {
    height: 100%;
    overflow: hidden;
    // -webkit-overflow-scrolling: touch;
}
   .cla-wrap {
    width: 100%;
    margin-top: .24rem;
    height: 20.01rem;
    overflow: hidden;
}
.p-msg {
    text-align: center;
    color: #999;
    padding: 0 0 .4rem 0px;
}
.cla-wrap .sub-nav {
    float: left;
    width: 3.8rem;
    height: 100%;
    margin-left: .24rem;
    -webkit-overflow-scrolling: touch;
}
.cla-wrap .sub-nav a.curr {
    background: url() repeat 0 0 ;
    color: #fff;
} 
.cla-wrap .sub-nav a {
    display: block;
    width: 100%;
    height: 1.76rem;
    line-height: 1.76rem;
    text-align: center;
    font-size: .52rem;
    color: #666;
    margin-bottom: 1px;
    background: #fff;
}
.cla-wrap .pro-area .pro-cont .pro-box dt {
    background-color: #FAFAFA;
    margin: 0 .4rem 1px;
    height: .88rem;
    line-height: .88rem;
    text-align: center;
    font-size: .44rem;
    color: #999999;
}
.cla-wrap .pro-area {
    margin-left: .24rem;
    
}
.cla-wrap .pro-area .pro-cont {
    margin-bottom: .4rem;
    background-color: #fff;
}
.cla-wrap .pro-area .pro-cont .pro-title {
    display: block;
    position: relative;
    height: 1.96rem;
    line-height: 1.96rem;
    text-align: center;
}
.cla-wrap .pro-area .pro-cont .pro-title img {
    display: block;
    height: 1.96rem;
    line-height: 1.96rem;
    margin: 0 auto;
}
.cla-wrap .pro-area .pro-cont .pro-box .pro-detail a img.p-opa {
    width: 2.4rem;
    height: 2.4rem;
    margin-bottom: .4rem;
    vertical-align: middle;
}
.cla-wrap .pro-area .pro-cont .pro-box .pro-detail {
    overflow: hidden;
 
    background-color: #fff;
}
.pro-cont .pro-box .pro-detail .pro-detail-box, .pro-cont .pro-box .pro-detail .pro-detail-box>div {
  display: inline-block;
  overflow: hidden;
}
 
.cla-wrap .pro-area .pro-cont .pro-box .pro-detail a {
    display: inline-block;
    float: left;
    width: 3.3rem;
    height: 4.6rem;
    padding: .4rem 0;
    text-align: center;
    color: #999;
    box-sizing: border-box;
} 
  
</style>
